#ifndef WXY_LIB_H__
#define WXY_LIB_H__

#include "main.h"

#define ABS(x) ((x)>0?(x):(-(x)))

union f_u8
{
	float f;
	uint8_t u8[4];
};

union u8_f
{
	uint8_t u8[4];
	float f;
};

union u32_u8
{
	uint32_t u32;
	uint8_t u8[4];
};

union u8_u32
{
	uint8_t u8[4];
	uint32_t u32;
};

union u16_u8
{
	uint16_t u16;
	uint8_t u8[2];
};

union u8_u16
{
	uint8_t u8[2];
	uint16_t u16;
};


union i32_u8
{
	int32_t i32;
	uint8_t u8[4];
};

union u8_i32
{
	uint8_t u8[4];
	int32_t i32;
};


union u8_i16
{
	uint8_t u8[2];
	int16_t i16;
};

union i16_u8
{
	int16_t i16;
	uint8_t u8[2];
};

union u32_i32
{
	uint32_t u32;
	int32_t i32;
};

union i32_u32
{
	int32_t i32;
	uint32_t u32;
};

union u16_i16
{
	uint16_t u16;
	int16_t i16;
};

union i16_u16
{
	int16_t i16;
	uint16_t u16;
};

#endif


